1. Field
The present invention relates to optimized traffic generation and reception for testing a communications network.
2. Description of the Related Art
In a packet switched network, a message to be sent is divided into packets of fixed or variable length. The packets are then sent individually over the network through multiple switches or nodes and then reassembled at a final destination before being delivered to a target device or end user. At the receiving end, the packets are then reassembled and the message is passed to the end user in a format compatible with the user's equipment.
Most packet switched networks operate according to a set of established protocols, implemented in a collection of interfaced layers known as a protocol stack. These layers may be defined according to the Open Systems Interconnect (OSI) model, having seven layers (from top to bottom): application, presentation, session, transport, network, data-link and physical. In general practice, though, the application layer is not considered part of the protocol stack, but instead is considered to lie on top of the protocol stack.
All but the physical layer of a protocol stack are typically software, though the network and data-link layer may be firmware and/or hardware. Each layer of the protocol stack typically exists to perform a specific function, such as addressing, routing, framing and physical transmission of packets. When a packet is to be transmitted over a network from a source system to a destination system, the packet will pass in a logically downward direction through layers of the protocol stack on the source system, and in a logically upward direction through corresponding layers of the protocol stack on the destination system. Each layer passes the packet to the adjacent layer, either up or down the protocol stack depending on whether the packet has been received or is being transmitted.
Each layer of the protocol stack in the transmitting process may add a respective header to the packet, which provides information to the corresponding layer in a receiving process. Thus, as a packet passes down through the protocol stack on a transmitting system, the packet may gain an additional header at each layer. At the bottom of the stack, the transmitting process may then frame the packet and physically transmit it over the network toward its destination. When the packet reaches its destination, the packet will then pass up through the protocol stack of the destination system. Each layer of the protocol stack in the destination system may obtain useful information from its associated header and will strip its header from the packet before passing the packet up to the next layer for processing. Application programs typically receives a byte stream from top layer of the protocol stack, not individual packets. The byte stream may consist of data that consists of a partial packet or data that covers more than one packet. This is very convenient for the application but may impair performance.
A variety of standards are known for use in packet switched networks. One of these, the TCP/IP suite, is typically used to manage reliable transmission of packets throughout the Internet and other IP networks. Typical stacks containing TCP/IP consist of five layers: physical, link, network (IP), transport (TCP) and application. These elements correspond to layers 1, 2, 3, 4 and 7 of the OSI model respectively.
The transport layer of TCP/IP corresponds to layer 4 of the OSI model. The transport layer allows source and destination machines to carry on a reliable conversation with each other.
The IP layer in TCP/IP corresponds to the network layer of the OSI model. The IP layer provides addressing information to facilitate independent routing of packets within or between networks and also includes other control layers, such as an Internet Control Message Protocol (ICMP) layer and an Address Resolution Protocol (ARP) layer.
The link layer under TCP/IP corresponds to the data-link layer of the OSI model. The link layer includes network interface card drivers to connect the machine to the physical network, such as an Ethernet network.
A common application-layer protocol is Hypertext Transfer Protocol (HTTP) which is used to transfer information between clients and servers over the World Wide Web. The client may be a web browser or other end-user tool. HTTP is a request/response protocol. The client or user agent initiates communications by establishing a TCP connection to the destination or source server. The connection may pass through intermediaries such as proxies, gateways, and tunnels. Once the connection is established, the source server waits to receive a request message from the user agent, and then returns a response message. A generic HTTP request message includes a request line containing the request, the Uniform Resource Identifier (i.e. the address), and the version of the HTTP protocol being employed. One or more header lines may follow the request line. The message concludes with a blank line and, optionally, a message body or payload. A generic HTTP response message includes a status line and, optionally, a message body or payload. Typically, an HTTP communication session will be comprised of the exchange of several messages to establish the session and to make and acknowledge a request and the exchange of several more messages to close the connection after the request has been satisfied.
In general, the machines that implement the HTTP/TCP/IP protocol stack are computers. Each of these computers includes one or more processors, memories, and input/output ports, and is managed by an operating system.
The computer memory may include a user space and a kernel space. The kernel space is an area of memory which is strictly reserved for running the kernel, device drivers and any kernel extensions. The TCP/IP protocol stack typically resides in kernel space, and the HTTP protocol typically resides in user space. Though some portions of the kernel space may be swapped (paged) out to the disk, some portions are typically never swappable. The user space is a memory area used by all applications and this memory can typically be swapped out at any time depending upon the current system requirements. The user space and the kernel space are distinct. An application program usually cannot access the kernel space directly. Application programs may, however, use the kernel to access system resources and hardware through system calls, and are therefore thought of as running above, or on top of, the kernel.
Typically, when an incoming packet enters a computer or other hardware device running a protocol stack, the destination of the packet may be some specific code within the kernel, or it may be an application program. In any event, the packet will typically be processed by multiple layers of the protocol stack and finally arrive at its destination. Similarly, an outgoing packet will typically be processed by multiple layers of the protocol stack before being transmitted onto the network.
When data (e.g., a byte stream) passes between the application layer and the TCP/IP protocol stack's transport layer, the data moves between user space and kernel space. Since user space and kernel space are separate areas of memory, however, the process of moving data includes copying the data to the destination area. This may also include deleting the original, either right away or in a housekeeping operation. Thus, in practice, once an outgoing payload has been processed by the application program in user space, it is copied to kernel space to be processed by the protocol stack. Similarly, once an incoming packet reaches the top of the TCP/IP protocol stack, its payload is copied to user space to be processed by the application. The request-response nature of the HTTP protocol requires significant time-consuming bidirectional data movement between the application layer and the TCP/IP protocol stack.